package com.asiainfo.ai.admin.utils;

import com.asiainfo.mlp.common.core.config.MlpPlatformConfig;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public final class SwaggerUtils {

    public static Info buildApiDocInfo(MlpPlatformConfig mlpPlatformConfig) {
        Info info = new Info();
        Contact contact = new Contact();
        info.title(mlpPlatformConfig.getPlatform());
        info.description(mlpPlatformConfig.getPlatformDesc());
        info.version(mlpPlatformConfig.getPlatformVersion());
        contact.setName(mlpPlatformConfig.getPlatformLinkman());
        contact.setEmail(mlpPlatformConfig.getPlatformLinkEmail());
        info.contact(contact);
        return info;
    }

}
